﻿@model OSBLE.Models.Users.UserProfile

@using OSBLE.Models

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>UserProfile</legend>

        @Html.HiddenFor(model => model.ID)

        <div class="editor-label">
            @Html.LabelFor(model => model.UserName)
            @Helpers.CreateToolTip(ToolTips.AdminUserName) 
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UserName)
            @Html.ValidationMessageFor(model => model.UserName)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Password)
        </div>
        <div class="editor-field">
            @Html.PasswordFor(model => model.Password)
            @Html.ValidationMessageFor(model => model.Password)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.SchoolID, "School")
            @Helpers.CreateToolTip(ToolTips.AdminUserSchool) 
        </div>
        <div class="editor-field">
            @Html.DropDownList("SchoolID", String.Empty)
            @Html.ValidationMessageFor(model => model.SchoolID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FirstName)
            @Helpers.CreateToolTip(ToolTips.AdminUserFirstName) 
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FirstName)
            @Html.ValidationMessageFor(model => model.FirstName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.LastName)
            @Helpers.CreateToolTip(ToolTips.AdminUserLastName) 
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LastName)
            @Html.ValidationMessageFor(model => model.LastName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Identification)
            @Helpers.CreateToolTip(ToolTips.AdminUserID) 
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Identification)
            @Html.ValidationMessageFor(model => model.Identification)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IsAdmin)
            @Helpers.CreateToolTip(ToolTips.AdminUserIsAdmin) 
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IsAdmin)
            @Html.ValidationMessageFor(model => model.IsAdmin)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IsApproved)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IsApproved)
            @Html.ValidationMessageFor(model => model.IsApproved)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CanCreateCourses)
            @Helpers.CreateToolTip(ToolTips.AdminUserIsCourseCreator) 
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CanCreateCourses)
            @Html.ValidationMessageFor(model => model.CanCreateCourses)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index") 
</div>
